package com.ulic.customerManApplication.achievementmodule.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.achievementmodule.bo.Achievement;
import com.ulic.customerManApplication.achievementmodule.dao.AchievementDao;
import com.ulic.customerManApplication.achievementmodule.service.AchievementService;
import com.ulic.customerManApplication.achievementmodule.vo.AchievementVO;
import com.ulic.customerManApplication.pager.PagerModel;
import com.ulic.customerManApplication.usermodule.bo.User;
@Component("achievementService")
public class AchievementServiceImpl implements AchievementService {

	private AchievementDao achievementDao;
	
	
	public AchievementDao getAchievementDao() {
		return achievementDao;
	}

	@Resource
	public void setAchievementDao(AchievementDao achievementDao) {
		this.achievementDao = achievementDao;
	}

	@Override
	public void deleteAchievement(Achievement achievement) throws Exception {

		achievementDao.deleteAchievement(achievement);
	}

	@Override
	public Achievement getAchievement(int id) {
		return achievementDao.getAchievement(id);
	}

	@Override
	public PagerModel getAchievements(int curPage) {
		return achievementDao.getAchievements(curPage);
	}

	@Override
	public List<Achievement> getAchievements(User user) {
		return achievementDao.getAchievements(user);
	}

	@Override
	public PagerModel getAchievements(AchievementVO achievementVO, int curPage) {
		return achievementDao.getAchievements(achievementVO, curPage);
	}

	@Override
	public void insertAchievement(Achievement achievement) throws Exception {

		achievementDao.insertAchievement(achievement);
	}

	@Override
	public void insertAchievements(List<Achievement> achievements)
			throws Exception {

		achievementDao.insertAchievements(achievements);
	}

	@Override
	public void updateAchievement(Achievement achievement) throws Exception {

		achievementDao.updateAchievement(achievement);
	}

	@Override
	public PagerModel getAchievements(AchievementVO achievementVO, int curPage,
			int totalNum) {
		return achievementDao.getAchievements(achievementVO, curPage, totalNum);
	}

}
